package org.ihelpuoo.weboo.security.action;

import org.ihelpuoo.weboo.action.http.ForwardAction;
import org.ihelpuoo.weboo.module.ActionContext;
import org.ihelpuoo.weboo.security.Account;

public class LoginAction extends ForwardAction
{
	@Override
	public String doForward(ActionContext context) throws Exception
	{
		Account that = (Account)context.getFormObject();
		Account account = (Account)context.pojo()
				.fetch(that,that.getQueryActivedFieldFilter(),null);
		if (!that.equals(account))
			return context.properties().getString("dest.failed");
		context.getSession().setAccount(account);
		return null;
	}
}
